#include <iostream>
#include <string>


inline int GetNum(char c) {
    return c - '0';
}

/**
 * 
 * 时间复杂度 O(1)
 * 空间复杂度 O(1)
 * 
 * ISBN号码
 */
int main() {
  
    std::string serialNumber;
    std::getline(std::cin, serialNumber);

    int sum = 0;
    sum += GetNum(serialNumber[0]) * 1;
    sum += GetNum(serialNumber[2]) * 2;
    sum += GetNum(serialNumber[3]) * 3;
    sum += GetNum(serialNumber[4]) * 4;
    sum += GetNum(serialNumber[6]) * 5;
    sum += GetNum(serialNumber[7]) * 6;
    sum += GetNum(serialNumber[8]) * 7;
    sum += GetNum(serialNumber[9]) * 8;
    sum += GetNum(serialNumber[10]) * 9;

    
    int result = sum % 11;
    if (result == 10) {
        if (serialNumber[12] == 'X') {
            std::cout << "Right";
        }else {
            serialNumber[12] = 'X';
            std::cout << serialNumber;
        }
    }
    else {
        if (serialNumber[12] == result + '0') {
            std::cout << "Right";
        }
        else {
            serialNumber[12] = result + '0';
            std::cout << serialNumber;
        }
    }
    return 0;
}